package com.designpatterns.command.command.ceiling;

import com.designpatterns.command.command.Command;
import com.designpatterns.command.entity.CeilingFan;

/**
 * @author Brook
 */
public class CeilingFanHighCommand implements Command {

    CeilingFan ceilingFan;
    int prevSpeed;

    public CeilingFanHighCommand(CeilingFan ceilingFan){
        this.ceilingFan = ceilingFan;
    }

    @Override
    public void excute() {
        prevSpeed = ceilingFan.getSpeed();
        ceilingFan.high();
    }

    @Override
    public void undo() {
        CeilingFanMediumCommand.skip(prevSpeed, ceilingFan);
    }
}
